package lumis.portal.serviceinterface.serialization;

import lumis.portal.PortalException;
import lumis.portal.serialization.BaseSerializationContext;
import lumis.portal.serialization.DeserializationContext;
import lumis.portal.serialization.SerializationContext;
import lumis.portal.serialization.SerializationMessageConfigNode;
import lumis.portal.serviceinterface.ServiceInterfaceConfig;
import lumis.portal.serviceinterface.style.serialization.ServiceInterfaceStyleSerializableConfig;

/**
 * Manager Interface for Service Interface serialization
 *
 * @version $Revision: 6239 $ $Date: 2007-03-26 15:50:32 -0300 (Mon, 26 Mar 2007) $
 * @since 4.0.7
 */
public interface IServiceInterfaceSerializationManager
{
	// DESERIALIZATION
	
	/**
	 * Deserialize a service interface style.
	 * @param deserializationContext
	 * @param serviceInterfaceStyleSerializableConfig
	 * @throws PortalException
	 */
	public void deserializeStyle(DeserializationContext deserializationContext, ServiceInterfaceStyleSerializableConfig serviceInterfaceStyleSerializableConfig) throws PortalException;

	// SERIALIZATION
	
	/**
	 * Serialize a service interface style.
	 * @param serializationContext
	 * @param serviceInterfaceStyleId
	 * @param serviceInterfaceId
	 * @return
	 * @throws PortalException
	 */
	public ServiceInterfaceStyleSerializableConfig serializeStyle(SerializationContext serializationContext, String serviceInterfaceStyleId, String serviceInterfaceId) throws PortalException;

	// GENERAL
	
	/**
	 * Set up a serialization context, defining settings such as class aliases, field aliases, transient fields, omitted collections etc.
	 * @param serializationContext
	 */
	public void setupSerializationContext(BaseSerializationContext serializationContext);

	/**
	 * Get a {@link SerializationMessageConfigNode} object containing partially recursive information about a service interface.
	 * @param baseSerializationContext
	 * @param serviceInterfaceConfig
	 * @return
	 * @throws PortalException
	 */
	public SerializationMessageConfigNode getSerializationMessageConfigNode(BaseSerializationContext baseSerializationContext, ServiceInterfaceConfig serviceInterfaceConfig) throws PortalException;
}
